<?php

	class class_loader {

		static function load($class_name) {
			$class_path = false;
			if(file_exists(LC_PATH.CORE_DIR.$class_name.'.class.php')) {
				$class_path = CORE_DIR.$class_name.'.class.php';
			} elseif(file_exists(LC_PATH.PLUGINS_DIR.'plugins/'.$class_name.'.class.php')) {
				$class_path = PLUGINS_DIR.$class_name.'.class.php';
			} elseif(file_exists(LC_PATH.MODELS_DIR.$class_name.'.class.php')) {
				$class_path = MODELS_DIR.$class_name.'.class.php';
			}
			if($class_path) {
				include(LC_PATH.$class_path);
			} else {
				throw new Exception('class_loader::load() - class not found.');
				return false;
			}
		}

	}

?>
